UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5l9cJ8/MVSBdaQ7Km/7VvcSOsfhQIQ0nxAY4oAFty4s='
WHERE
key_id = '0f81ea3c294dda1f22dde55084ed9fdace40d292ba194111e3292f203635f0ce'
AND (
token = '5l9cJ8/MVSBdaQ7Km/7VvcSOsfhQIQ0nxAY4oAFty4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)