UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fuvRNTsY/yq18d9HwlGdCpTq85GSit7ya/RA5bldy+A='
WHERE
key_id = '27827c43725361b517b9daae2f9ba15ca29e5c16cf7caa47d5b657d5b2dfdd4f'
AND (
token = 'fuvRNTsY/yq18d9HwlGdCpTq85GSit7ya/RA5bldy+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)