UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HfQXjSmo1yyoCR6NSrc7G1K6K1Zgn82p6B8liwZVZoA='
WHERE
key_id = '042c0704b9b40d6863b67b351ed6e03d95bac0510b380d44d23f0c42e49dc796'
AND (
token = 'HfQXjSmo1yyoCR6NSrc7G1K6K1Zgn82p6B8liwZVZoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)