UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X6ZrdIVMqSblKznO5N4DnVAuX8FMRbD7f04R8P4by/U=' 
WHERE 
  key_id = '83dcb3d2f4e052d7b77835b2452ceea2f265d3b49924082cbac51a57f22e3d39' 
  AND (
    token = 'X6ZrdIVMqSblKznO5N4DnVAuX8FMRbD7f04R8P4by/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024