UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ShUTtZ9iM41w+lRlZs0LWhSz791t0BGHC8GbFkaFzv8='
WHERE
key_id = '8e16a41464e57b44d1c83d84de64a9d008399b323de13719d9c50ee86c0ae2bd'
AND (
token = 'ShUTtZ9iM41w+lRlZs0LWhSz791t0BGHC8GbFkaFzv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)