UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vLuRC9RUN8NKeGjigNbcGJ6KFO83V3ORlRnNM1hFzLE='
WHERE
key_id = '42fff9f13691490be6f007f2a8b910f8f95c3433af445c48b80034585364a54f'
AND (
token = 'vLuRC9RUN8NKeGjigNbcGJ6KFO83V3ORlRnNM1hFzLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)