UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e1fbw8wMoM9cfOULwfXJGoGDBPrmTywWcBU7xWTnYwA='
WHERE
key_id = '38b26175e6ce9c6ac30cc47b57a25c9cbbcf1002d622a23554a1bb061f474d25'
AND (
token = 'e1fbw8wMoM9cfOULwfXJGoGDBPrmTywWcBU7xWTnYwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)