UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fx649pnf3KS/Kf9Gg6k1iroLMZ+XU9EREx3v6k0GgMg='
WHERE
key_id = 'ecbd217cf3a2efccbefba6aa35956a4dfeed7cb8f398e809bdf920f0377e2451'
AND (
token = 'Fx649pnf3KS/Kf9Gg6k1iroLMZ+XU9EREx3v6k0GgMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)