UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDIQm1ABlqTD74rzhbEftADNqzva6eBgaK++rEuQS+E=' 
WHERE 
  key_id = '6ef27c42f0c232888b5cd9251a73ebee294c26fd04499fad0371f4f6cdedb715' 
  AND (
    token = 'pDIQm1ABlqTD74rzhbEftADNqzva6eBgaK++rEuQS+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028