UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GHeEXHacIanwwUJ/06H4x4iDXfB+5+e9KgvoCoMeM4k='
WHERE
key_id = 'b5702c4b383e21da4f5b5cee5826f26a99a448a90cc70935cfbc3a81902028eb'
AND (
token = 'GHeEXHacIanwwUJ/06H4x4iDXfB+5+e9KgvoCoMeM4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)