UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JACDPvyeVQsfU5KmX034mkUYK0o203DcvIYxNtG2cLM=' 
WHERE 
  key_id = '7d26f15f1f1b747600253367c4be56c2b8cafae6f354a2b024683e04e0def7fe' 
  AND (
    token = 'JACDPvyeVQsfU5KmX034mkUYK0o203DcvIYxNtG2cLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041