UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kekleynPEU5XhYat+kEPk0hQUotR+d2/t775p0lwKhc='
WHERE
key_id = 'e32c4529bbb488c685cfa9fe02a296f66b3299e07a6eca0064ddedf142caa15f'
AND (
token = 'kekleynPEU5XhYat+kEPk0hQUotR+d2/t775p0lwKhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)