UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVcFxzpcHMwrBEFmClbmmZvddYHIC3QTLu8Aoo+21Qg='
WHERE
key_id = '6f3b8b2979d530c31fe63be446555573f620aabcbc09aeb42d09934f8a1b2a5f'
AND (
token = 'jVcFxzpcHMwrBEFmClbmmZvddYHIC3QTLu8Aoo+21Qg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)