UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wTf0jA2qS3AR0Yvu+lYKCw9MmjC76JSX6Jci3w8lkys=' 
WHERE 
  key_id = '55ddc983311a2e64a2cc90c804191f9f36f8e9de1bdf708a5680a4ee1bb01b27' 
  AND (
    token = 'wTf0jA2qS3AR0Yvu+lYKCw9MmjC76JSX6Jci3w8lkys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054