UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IKLY0omLDWnTeZjaH/EPBENYW6p42zcrMZB5bc7I4RU='
WHERE
key_id = '2f0df4043fa90f9aa3c454d297af6de579e5bb9d1110b5908736b7815fdcf1df'
AND (
token = 'IKLY0omLDWnTeZjaH/EPBENYW6p42zcrMZB5bc7I4RU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)