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

Query time 0.00039