UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XyoHer6LqUAi+rRkYdHDrLfpapmmPGIdMc9uJCBBYOE=' 
WHERE 
  key_id = '9c5f9fbe1aaec4357ec64617fdfc92a7aa1abb7d36ee3aa38f37bb09b36e8a24' 
  AND (
    token = 'XyoHer6LqUAi+rRkYdHDrLfpapmmPGIdMc9uJCBBYOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049