UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CVNGo659gcO1QKscVEDyC4xes354nsq5JA3EkSLSA9U='
WHERE
key_id = '4398e89bba35b3c32f690af0a7a913f2bd6b76f0a3f85a8bfce7abb84f0448d9'
AND (
token = 'CVNGo659gcO1QKscVEDyC4xes354nsq5JA3EkSLSA9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)