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

Query time 0.00032