UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G99xRmIqHFp6yUZrtClJFugAU/dFoaQRI/F0PQuIUAM='
WHERE
key_id = 'd3042f22eca67c1273276efdaf3011eb0f3f5b873a9e8025edc4d43a5b370bf1'
AND (
token = 'G99xRmIqHFp6yUZrtClJFugAU/dFoaQRI/F0PQuIUAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)