UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vueBq49fjxP2jdQrZsFcgt1rC/rRLooqxUlD/AW4VE4='
WHERE
key_id = '22d42a4f8002ba282bd5a2ded129d5036e9a171fe1a267df3a032381fbaf8344'
AND (
token = 'vueBq49fjxP2jdQrZsFcgt1rC/rRLooqxUlD/AW4VE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)