UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qI9cURozWZ0BzAq4C/ahRhwWcXU+1NdXTezfTjjDWUI='
WHERE
key_id = '82032c1e53f88422adc70528b9cac9298e6cff265a39769249104d6447e3e310'
AND (
token = 'qI9cURozWZ0BzAq4C/ahRhwWcXU+1NdXTezfTjjDWUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)