UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UYbsk6TTJmjp+nIErxh3/C/zSLPTX4cjrS0EhRHXf44='
WHERE
key_id = '36b9cabf4a2278f69b7a624b3525c876509a4dbc5870414a352d00434185f857'
AND (
token = 'UYbsk6TTJmjp+nIErxh3/C/zSLPTX4cjrS0EhRHXf44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)