UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jIF7WapIQVfZM5VM5iCYo2iaJPSSxcOPav3pPBBCO7o=' 
WHERE 
  key_id = 'cb5c0aa57dcfe23e1805266859d90d9b3dfee283a56d7bf6dda69782f8c509db' 
  AND (
    token = 'jIF7WapIQVfZM5VM5iCYo2iaJPSSxcOPav3pPBBCO7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017