UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wycPeRl9PJ5Ujtxx4+lIcgr6g5dls0wd+5cDXfaOa8='
WHERE
key_id = 'e0e1fa43552e3d693e1ae0e296bb60e07d197209da19ffb473bea580979fd17e'
AND (
token = '5wycPeRl9PJ5Ujtxx4+lIcgr6g5dls0wd+5cDXfaOa8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)