UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N91kwUQPsvD7N791UJ8bvTcyoYkw4Ihf8UuuL26ROc8=' 
WHERE 
  key_id = '85df83bb2d130dee4c5bf77f4c1c620d2e77dcfa830d83ba11c61f3267f0d847' 
  AND (
    token = 'N91kwUQPsvD7N791UJ8bvTcyoYkw4Ihf8UuuL26ROc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031