UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZn4D0bXPqCoJduXNiKq8KP1tAV5/NVwMqaRXd2arMo=' 
WHERE 
  key_id = '28e840be2df9461960c90fc0e84a4587278f422c5a76014aff832d0444f97e18' 
  AND (
    token = 'jZn4D0bXPqCoJduXNiKq8KP1tAV5/NVwMqaRXd2arMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015