UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Z4CQfUWsvmCWf8wLcXTGi29BkLq72h6Z5EL7tmTSng='
WHERE
key_id = 'cbbf04911b077fd86ad3d6f02b8328a3218e9862c42b4f384d042a5f926f2324'
AND (
token = '/Z4CQfUWsvmCWf8wLcXTGi29BkLq72h6Z5EL7tmTSng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)