UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aOmXUeoyzkfsBA/ViFH80zWNmRP3RuZU5KF3venJgMM=' 
WHERE 
  key_id = '690b64bb280e01aea406f2008627929cbba1c8e2f2355dd3c852bf8ffff41dd3' 
  AND (
    token = 'aOmXUeoyzkfsBA/ViFH80zWNmRP3RuZU5KF3venJgMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026