UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJA4bcWm9t70MwAJtI2Vcfz8CP4DdzCzbemGERLcLX0=' 
WHERE 
  key_id = '538fd626a5defeeb280946f74029ff95fca9b3c9f5f68bd4df0203fd448e1187' 
  AND (
    token = 'FJA4bcWm9t70MwAJtI2Vcfz8CP4DdzCzbemGERLcLX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019