UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PJmQRbac+7+Fi1EWGGjT7mt8GxqTLQV2orBJ9NiS3Zc='
WHERE
key_id = '1c85ad2050d0b5489065cb3326c409573fb10f61036d9fdae101d50e05c7b067'
AND (
token = 'PJmQRbac+7+Fi1EWGGjT7mt8GxqTLQV2orBJ9NiS3Zc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)