UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xhfrP3rrt/+7OmpuqJZgwDcWQ+oKbd4yiF7sKbG/+zQ=' 
WHERE 
  key_id = 'd79d84225002184d611f743a98907ff246e0ebc594c4b54a88a0a9fdac0d69a1' 
  AND (
    token = 'xhfrP3rrt/+7OmpuqJZgwDcWQ+oKbd4yiF7sKbG/+zQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044