UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FKtGOISLdpMpx75VGse0YpW0xbH8IqOuwljL2OIqvvo=' 
WHERE 
  key_id = 'd61e9286fcb8e6fe356c5ec385b7e5581b4245fc12d040cbcce568241e12bd26' 
  AND (
    token = 'FKtGOISLdpMpx75VGse0YpW0xbH8IqOuwljL2OIqvvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038