UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xVAHOwF58u6CbFiVuf/Lf/fOnqjDmKxSKeBlHM7eJx8='
WHERE
key_id = '153c79c475f9c7adfaa75fc09b0f0a833056b06a5de314dc37fc746be31fd20e'
AND (
token = 'xVAHOwF58u6CbFiVuf/Lf/fOnqjDmKxSKeBlHM7eJx8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)