UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8KPwOKgKK1j6jJMdlBaXO+afwHC7/szhTrixEQCyrnQ='
WHERE
key_id = '93f1b5845dbc32192206530662fd4bfb88b5d139c5835ece3e0fdda622c7f2ec'
AND (
token = '8KPwOKgKK1j6jJMdlBaXO+afwHC7/szhTrixEQCyrnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)