UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OgidFUUCrKM5HMRMFzn+jhuzDPYG6J5zo6vEAkkyUyQ='
WHERE
key_id = '053dfd5c0548bc2c9aafdf6d451c84ff65cc39013449afc1d2ff289af78de423'
AND (
token = 'OgidFUUCrKM5HMRMFzn+jhuzDPYG6J5zo6vEAkkyUyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)