UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r0yl82nZQTHyTEb4CLEcn/PkZyFk19Op5S1pV3UvPAE=' 
WHERE 
  key_id = 'ab9d9d818ecdd4c13556d3b53b1560616f975506443f263fb42b5ce53c091e6e' 
  AND (
    token = 'r0yl82nZQTHyTEb4CLEcn/PkZyFk19Op5S1pV3UvPAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020