UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ctbzoxyqMfTyf/JUQE3icoN2fbW+KBWB4SxJqjpnDpk='
WHERE
key_id = 'e5c8cad08d4f824073134a1f3398c716f6abcee7340402f1c485d1756b329824'
AND (
token = 'ctbzoxyqMfTyf/JUQE3icoN2fbW+KBWB4SxJqjpnDpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)