UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nAR8GsEPNgI6JGNRzfD8bhQXue/RFWl1Qq41MiHbQDs=' 
WHERE 
  key_id = '936574fb0417178e1eebf2009da558b3c1058f679ea14d085e8a61ead514794a' 
  AND (
    token = 'nAR8GsEPNgI6JGNRzfD8bhQXue/RFWl1Qq41MiHbQDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044