UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f/PAJksq7wIZHFmK5aaKmdZYVL71mg8kWQaJLfnzQFI=' 
WHERE 
  key_id = '81759770d7944a13676744f913d456bb7bcb5ce9692e5e6f36c3593ff8703027' 
  AND (
    token = 'f/PAJksq7wIZHFmK5aaKmdZYVL71mg8kWQaJLfnzQFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023