UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qHZ7W3j9wAZdLJvZlIwxnY4zNqOizlSQzLA+CGo6TbQ=' 
WHERE 
  key_id = '41e0469bd5e962e233e86f3453cfc90d29ac535ddd197873d298becb533518b5' 
  AND (
    token = 'qHZ7W3j9wAZdLJvZlIwxnY4zNqOizlSQzLA+CGo6TbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029